home *** CD-ROM | disk | FTP | other *** search
/ Workbench Add-On / Workbench Add-On - Volume 1.iso / BBS-Archive / Dev / gcc263-src.lha / gcc-2.6.3 / gcc.info-3 (.txt) < prev    next >
GNU Info File  |  1994-11-23  |  51KB  |  980 lines

  1. This is Info file gcc.info, produced by Makeinfo-1.55 from the input
  2. file gcc.texi.
  3.    This file documents the use and the internals of the GNU compiler.
  4.    Published by the Free Software Foundation 675 Massachusetts Avenue
  5. Cambridge, MA 02139 USA
  6.    Copyright (C) 1988, 1989, 1992, 1993, 1994 Free Software Foundation,
  7.    Permission is granted to make and distribute verbatim copies of this
  8. manual provided the copyright notice and this permission notice are
  9. preserved on all copies.
  10.    Permission is granted to copy and distribute modified versions of
  11. this manual under the conditions for verbatim copying, provided also
  12. that the sections entitled "GNU General Public License," "Funding for
  13. Free Software," and "Protect Your Freedom--Fight `Look And Feel'" are
  14. included exactly as in the original, and provided that the entire
  15. resulting derived work is distributed under the terms of a permission
  16. notice identical to this one.
  17.    Permission is granted to copy and distribute translations of this
  18. manual into another language, under the above conditions for modified
  19. versions, except that the sections entitled "GNU General Public
  20. License," "Funding for Free Software," and "Protect Your Freedom--Fight
  21. `Look And Feel'", and this permission notice, may be included in
  22. translations approved by the Free Software Foundation instead of in the
  23. original English.
  24. File: gcc.info,  Node: Debugging Options,  Next: Optimize Options,  Prev: Warning Options,  Up: Invoking GCC
  25. Options for Debugging Your Program or GNU CC
  26. ============================================
  27.    GNU CC has various special options that are used for debugging
  28. either your program or GCC:
  29.      Produce debugging information in the operating system's native
  30.      format (stabs, COFF, XCOFF, or DWARF).  GDB can work with this
  31.      debugging information.
  32.      On most systems that use stabs format, `-g' enables use of extra
  33.      debugging information that only GDB can use; this extra information
  34.      makes debugging work better in GDB but will probably make other
  35.      debuggers crash or refuse to read the program.  If you want to
  36.      control for certain whether to generate the extra information, use
  37.      `-gstabs+', `-gstabs', `-gxcoff+', `-gxcoff', `-gdwarf+', or
  38.      `-gdwarf' (see below).
  39.      Unlike most other C compilers, GNU CC allows you to use `-g' with
  40.      `-O'.  The shortcuts taken by optimized code may occasionally
  41.      produce surprising results: some variables you declared may not
  42.      exist at all; flow of control may briefly move where you did not
  43.      expect it; some statements may not be executed because they
  44.      compute constant results or their values were already at hand;
  45.      some statements may execute in different places because they were
  46.      moved out of loops.
  47.      Nevertheless it proves possible to debug optimized output.  This
  48.      makes it reasonable to use the optimizer for programs that might
  49.      have bugs.
  50.      The following options are useful when GNU CC is generated with the
  51.      capability for more than one debugging format.
  52. `-ggdb'
  53.      Produce debugging information in the native format (if that is
  54.      supported), including GDB extensions if at all possible.
  55. `-gstabs'
  56.      Produce debugging information in stabs format (if that is
  57.      supported), without GDB extensions.  This is the format used by
  58.      DBX on most BSD systems.  On MIPS, Alpha and System V Release 4
  59.      systems this option produces stabs debugging output which is not
  60.      understood by DBX or SDB.  On System V Release 4 systems this
  61.      option requires the GNU assembler.
  62. `-gstabs+'
  63.      Produce debugging information in stabs format (if that is
  64.      supported), using GNU extensions understood only by the GNU
  65.      debugger (GDB).  The use of these extensions is likely to make
  66.      other debuggers crash or refuse to read the program.
  67. `-gcoff'
  68.      Produce debugging information in COFF format (if that is
  69.      supported).  This is the format used by SDB on most System V
  70.      systems prior to System V Release 4.
  71. `-gxcoff'
  72.      Produce debugging information in XCOFF format (if that is
  73.      supported).  This is the format used by the DBX debugger on IBM
  74.      RS/6000 systems.
  75. `-gxcoff+'
  76.      Produce debugging information in XCOFF format (if that is
  77.      supported), using GNU extensions understood only by the GNU
  78.      debugger (GDB).  The use of these extensions is likely to make
  79.      other debuggers crash or refuse to read the program.
  80. `-gdwarf'
  81.      Produce debugging information in DWARF format (if that is
  82.      supported).  This is the format used by SDB on most System V
  83.      Release 4 systems.
  84. `-gdwarf+'
  85.      Produce debugging information in DWARF format (if that is
  86.      supported), using GNU extensions understood only by the GNU
  87.      debugger (GDB).  The use of these extensions is likely to make
  88.      other debuggers crash or refuse to read the program.
  89. `-gLEVEL'
  90. `-ggdbLEVEL'
  91. `-gstabsLEVEL'
  92. `-gcoffLEVEL'
  93. `-gxcoffLEVEL'
  94. `-gdwarfLEVEL'
  95.      Request debugging information and also use LEVEL to specify how
  96.      much information.  The default level is 2.
  97.      Level 1 produces minimal information, enough for making backtraces
  98.      in parts of the program that you don't plan to debug.  This
  99.      includes descriptions of functions and external variables, but no
  100.      information about local variables and no line numbers.
  101.      Level 3 includes extra information, such as all the macro
  102.      definitions present in the program.  Some debuggers support macro
  103.      expansion when you use `-g3'.
  104.      Generate extra code to write profile information suitable for the
  105.      analysis program `prof'.  You must use this option when compiling
  106.      the source files you want data about, and you must also use it when
  107.      linking.
  108. `-pg'
  109.      Generate extra code to write profile information suitable for the
  110.      analysis program `gprof'.  You must use this option when compiling
  111.      the source files you want data about, and you must also use it when
  112.      linking.
  113.      Generate extra code to write profile information for basic blocks,
  114.      which will record the number of times each basic block is
  115.      executed, the basic block start address, and the function name
  116.      containing the basic block.  If `-g' is used, the line number and
  117.      filename of the start of the basic block will also be recorded.
  118.      If not overridden by the machine description, the default action is
  119.      to append to the text file `bb.out'.
  120.      This data could be analyzed by a program like `tcov'.  Note,
  121.      however, that the format of the data is not what `tcov' expects.
  122.      Eventually GNU `gprof' should be extended to process this data.
  123. `-dLETTERS'
  124.      Says to make debugging dumps during compilation at times specified
  125.      by LETTERS.  This is used for debugging the compiler.  The file
  126.      names for most of the dumps are made by appending a word to the
  127.      source file name (e.g.  `foo.c.rtl' or `foo.c.jump').  Here are the
  128.      possible letters for use in LETTERS, and their meanings:
  129.     `M'
  130.           Dump all macro definitions, at the end of preprocessing, and
  131.           write no output.
  132.     `N'
  133.           Dump all macro names, at the end of preprocessing.
  134.     `D'
  135.           Dump all macro definitions, at the end of preprocessing, in
  136.           addition to normal output.
  137.     `y'
  138.           Dump debugging information during parsing, to standard error.
  139.     `r'
  140.           Dump after RTL generation, to `FILE.rtl'.
  141.     `x'
  142.           Just generate RTL for a function instead of compiling it.
  143.           Usually used with `r'.
  144.     `j'
  145.           Dump after first jump optimization, to `FILE.jump'.
  146.     `s'
  147.           Dump after CSE (including the jump optimization that sometimes
  148.           follows CSE), to `FILE.cse'.
  149.     `L'
  150.           Dump after loop optimization, to `FILE.loop'.
  151.     `t'
  152.           Dump after the second CSE pass (including the jump
  153.           optimization that sometimes follows CSE), to `FILE.cse2'.
  154.     `f'
  155.           Dump after flow analysis, to `FILE.flow'.
  156.     `c'
  157.           Dump after instruction combination, to the file
  158.           `FILE.combine'.
  159.     `S'
  160.           Dump after the first instruction scheduling pass, to
  161.           `FILE.sched'.
  162.     `l'
  163.           Dump after local register allocation, to `FILE.lreg'.
  164.     `g'
  165.           Dump after global register allocation, to `FILE.greg'.
  166.     `R'
  167.           Dump after the second instruction scheduling pass, to
  168.           `FILE.sched2'.
  169.     `J'
  170.           Dump after last jump optimization, to `FILE.jump2'.
  171.     `d'
  172.           Dump after delayed branch scheduling, to `FILE.dbr'.
  173.     `k'
  174.           Dump after conversion from registers to stack, to
  175.           `FILE.stack'.
  176.     `a'
  177.           Produce all the dumps listed above.
  178.     `m'
  179.           Print statistics on memory usage, at the end of the run, to
  180.           standard error.
  181.     `p'
  182.           Annotate the assembler output with a comment indicating which
  183.           pattern and alternative was used.
  184. `-fpretend-float'
  185.      When running a cross-compiler, pretend that the target machine
  186.      uses the same floating point format as the host machine.  This
  187.      causes incorrect output of the actual floating constants, but the
  188.      actual instruction sequence will probably be the same as GNU CC
  189.      would make when running on the target machine.
  190. `-save-temps'
  191.      Store the usual "temporary" intermediate files permanently; place
  192.      them in the current directory and name them based on the source
  193.      file.  Thus, compiling `foo.c' with `-c -save-temps' would produce
  194.      files `foo.i' and `foo.s', as well as `foo.o'.
  195. `-print-file-name=LIBRARY'
  196.      Print the full absolute name of the library file LIBRARY that
  197.      would be used when linking--and don't do anything else.  With this
  198.      option, GNU CC does not compile or link anything; it just prints
  199.      the file name.
  200. `-print-prog-name=PROGRAM'
  201.      Like `-print-file-name', but searches for a program such as `cpp'.
  202. `-print-libgcc-file-name'
  203.      Same as `-print-file-name=libgcc.a'.
  204.      This is useful when you use `-nostdlib' but you do want to link
  205.      with `libgcc.a'.  You can do
  206.           gcc -nostdlib FILES... `gcc -print-libgcc-file-name`
  207. File: gcc.info,  Node: Optimize Options,  Next: Preprocessor Options,  Prev: Debugging Options,  Up: Invoking GCC
  208. Options That Control Optimization
  209. =================================
  210.    These options control various sorts of optimizations:
  211. `-O1'
  212.      Optimize.  Optimizing compilation takes somewhat more time, and a
  213.      lot more memory for a large function.
  214.      Without `-O', the compiler's goal is to reduce the cost of
  215.      compilation and to make debugging produce the expected results.
  216.      Statements are independent: if you stop the program with a
  217.      breakpoint between statements, you can then assign a new value to
  218.      any variable or change the program counter to any other statement
  219.      in the function and get exactly the results you would expect from
  220.      the source code.
  221.      Without `-O', the compiler only allocates variables declared
  222.      `register' in registers.  The resulting compiled code is a little
  223.      worse than produced by PCC without `-O'.
  224.      With `-O', the compiler tries to reduce code size and execution
  225.      time.
  226.      When you specify `-O', the compiler turns on `-fthread-jumps' and
  227.      `-fdefer-pop' on all machines.  The compiler turns on
  228.      `-fdelayed-branch' on machines that have delay slots, and
  229.      `-fomit-frame-pointer' on machines that can support debugging even
  230.      without a frame pointer.  On some machines the compiler also turns
  231.      on other flags.
  232. `-O2'
  233.      Optimize even more.  GNU CC performs nearly all supported
  234.      optimizations that do not involve a space-speed tradeoff.  The
  235.      compiler does not perform loop unrolling or function inlining when
  236.      you specify `-O2'.  As compared to `-O', this option increases
  237.      both compilation time and the performance of the generated code.
  238.      `-O2' turns on all optional optimizations except for loop unrolling
  239.      and function inlining.  It also turns on frame pointer elimination
  240.      on machines where doing so does not interfer with debugging.
  241. `-O3'
  242.      Optimize yet more.  `-O3' turns on all optimizations specified by
  243.      `-O2' and also turns on the `inline-functions' option.
  244. `-O0'
  245.      Do not optimize.
  246.      If you use multiple `-O' options, with or without level numbers,
  247.      the last such option is the one that is effective.
  248.    Options of the form `-fFLAG' specify machine-independent flags.
  249. Most flags have both positive and negative forms; the negative form of
  250. `-ffoo' would be `-fno-foo'.  In the table below, only one of the forms
  251. is listed--the one which is not the default.  You can figure out the
  252. other form by either removing `no-' or adding it.
  253. `-ffloat-store'
  254.      Do not store floating point variables in registers, and inhibit
  255.      other options that might change whether a floating point value is
  256.      taken from a register or memory.
  257.      This option prevents undesirable excess precision on machines such
  258.      as the 68000 where the floating registers (of the 68881) keep more
  259.      precision than a `double' is supposed to have.  For most programs,
  260.      the excess precision does only good, but a few programs rely on the
  261.      precise definition of IEEE floating point.  Use `-ffloat-store' for
  262.      such programs.
  263. `-fno-default-inline'
  264.      Do not make member functions inline by default merely because they
  265.      are defined inside the class scope (C++ only).  Otherwise, when
  266.      you specify `-O', member functions defined inside class scope are
  267.      compiled inline by default; i.e., you don't need to add `inline'
  268.      in front of the member function name.
  269. `-fno-defer-pop'
  270.      Always pop the arguments to each function call as soon as that
  271.      function returns.  For machines which must pop arguments after a
  272.      function call, the compiler normally lets arguments accumulate on
  273.      the stack for several function calls and pops them all at once.
  274. `-fforce-mem'
  275.      Force memory operands to be copied into registers before doing
  276.      arithmetic on them.  This may produce better code by making all
  277.      memory references potential common subexpressions.  When they are
  278.      not common subexpressions, instruction combination should
  279.      eliminate the separate register-load.  I am interested in hearing
  280.      about the difference this makes.
  281. `-fforce-addr'
  282.      Force memory address constants to be copied into registers before
  283.      doing arithmetic on them.  This may produce better code just as
  284.      `-fforce-mem' may.  I am interested in hearing about the
  285.      difference this makes.
  286. `-fomit-frame-pointer'
  287.      Don't keep the frame pointer in a register for functions that
  288.      don't need one.  This avoids the instructions to save, set up and
  289.      restore frame pointers; it also makes an extra register available
  290.      in many functions.  *It also makes debugging impossible on some
  291.      machines.*
  292.      On some machines, such as the Vax, this flag has no effect, because
  293.      the standard calling sequence automatically handles the frame
  294.      pointer and nothing is saved by pretending it doesn't exist.  The
  295.      machine-description macro `FRAME_POINTER_REQUIRED' controls
  296.      whether a target machine supports this flag.  *Note Registers::.
  297. `-fno-inline'
  298.      Don't pay attention to the `inline' keyword.  Normally this option
  299.      is used to keep the compiler from expanding any functions inline.
  300.      Note that if you are not optimizing, no functions can be expanded
  301.      inline.
  302. `-finline-functions'
  303.      Integrate all simple functions into their callers.  The compiler
  304.      heuristically decides which functions are simple enough to be worth
  305.      integrating in this way.
  306.      If all calls to a given function are integrated, and the function
  307.      is declared `static', then the function is normally not output as
  308.      assembler code in its own right.
  309. `-fkeep-inline-functions'
  310.      Even if all calls to a given function are integrated, and the
  311.      function is declared `static', nevertheless output a separate
  312.      run-time callable version of the function.
  313. `-fno-function-cse'
  314.      Do not put function addresses in registers; make each instruction
  315.      that calls a constant function contain the function's address
  316.      explicitly.
  317.      This option results in less efficient code, but some strange hacks
  318.      that alter the assembler output may be confused by the
  319.      optimizations performed when this option is not used.
  320. `-ffast-math'
  321.      This option allows GCC to violate some ANSI or IEEE rules and/or
  322.      specifications in the interest of optimizing code for speed.  For
  323.      example, it allows the compiler to assume arguments to the `sqrt'
  324.      function are non-negative numbers and that no floating-point values
  325.      are NaNs.
  326.      This option should never be turned on by any `-O' option since it
  327.      can result in incorrect output for programs which depend on an
  328.      exact implementation of IEEE or ANSI rules/specifications for math
  329.      functions.
  330.    The following options control specific optimizations.  The `-O2'
  331. option turns on all of these optimizations except `-funroll-loops' and
  332. `-funroll-all-loops'.  On most machines, the `-O' option turns on the
  333. `-fthread-jumps' and `-fdelayed-branch' options, but specific machines
  334. may handle it differently.
  335.    You can use the following flags in the rare cases when "fine-tuning"
  336. of optimizations to be performed is desired.
  337. `-fstrength-reduce'
  338.      Perform the optimizations of loop strength reduction and
  339.      elimination of iteration variables.
  340. `-fthread-jumps'
  341.      Perform optimizations where we check to see if a jump branches to a
  342.      location where another comparison subsumed by the first is found.
  343.      If so, the first branch is redirected to either the destination of
  344.      the second branch or a point immediately following it, depending
  345.      on whether the condition is known to be true or false.
  346. `-fcse-follow-jumps'
  347.      In common subexpression elimination, scan through jump instructions
  348.      when the target of the jump is not reached by any other path.  For
  349.      example, when CSE encounters an `if' statement with an `else'
  350.      clause, CSE will follow the jump when the condition tested is
  351.      false.
  352. `-fcse-skip-blocks'
  353.      This is similar to `-fcse-follow-jumps', but causes CSE to follow
  354.      jumps which conditionally skip over blocks.  When CSE encounters a
  355.      simple `if' statement with no else clause, `-fcse-skip-blocks'
  356.      causes CSE to follow the jump around the body of the `if'.
  357. `-frerun-cse-after-loop'
  358.      Re-run common subexpression elimination after loop optimizations
  359.      has been performed.
  360. `-fexpensive-optimizations'
  361.      Perform a number of minor optimizations that are relatively
  362.      expensive.
  363. `-fdelayed-branch'
  364.      If supported for the target machine, attempt to reorder
  365.      instructions to exploit instruction slots available after delayed
  366.      branch instructions.
  367. `-fschedule-insns'
  368.      If supported for the target machine, attempt to reorder
  369.      instructions to eliminate execution stalls due to required data
  370.      being unavailable.  This helps machines that have slow floating
  371.      point or memory load instructions by allowing other instructions
  372.      to be issued until the result of the load or floating point
  373.      instruction is required.
  374. `-fschedule-insns2'
  375.      Similar to `-fschedule-insns', but requests an additional pass of
  376.      instruction scheduling after register allocation has been done.
  377.      This is especially useful on machines with a relatively small
  378.      number of registers and where memory load instructions take more
  379.      than one cycle.
  380. `-fcaller-saves'
  381.      Enable values to be allocated in registers that will be clobbered
  382.      by function calls, by emitting extra instructions to save and
  383.      restore the registers around such calls.  Such allocation is done
  384.      only when it seems to result in better code than would otherwise
  385.      be produced.
  386.      This option is enabled by default on certain machines, usually
  387.      those which have no call-preserved registers to use instead.
  388. `-funroll-loops'
  389.      Perform the optimization of loop unrolling.  This is only done for
  390.      loops whose number of iterations can be determined at compile time
  391.      or run time.  `-funroll-loop' implies both `-fstrength-reduce' and
  392.      `-frerun-cse-after-loop'.
  393. `-funroll-all-loops'
  394.      Perform the optimization of loop unrolling.  This is done for all
  395.      loops and usually makes programs run more slowly.
  396.      `-funroll-all-loops' implies `-fstrength-reduce' as well as
  397.      `-frerun-cse-after-loop'.
  398. `-fno-peephole'
  399.      Disable any machine-specific peephole optimizations.
  400. File: gcc.info,  Node: Preprocessor Options,  Next: Assembler Options,  Prev: Optimize Options,  Up: Invoking GCC
  401. Options Controlling the Preprocessor
  402. ====================================
  403.    These options control the C preprocessor, which is run on each C
  404. source file before actual compilation.
  405.    If you use the `-E' option, nothing is done except preprocessing.
  406. Some of these options make sense only together with `-E' because they
  407. cause the preprocessor output to be unsuitable for actual compilation.
  408. `-include FILE'
  409.      Process FILE as input before processing the regular input file.
  410.      In effect, the contents of FILE are compiled first.  Any `-D' and
  411.      `-U' options on the command line are always processed before
  412.      `-include FILE', regardless of the order in which they are
  413.      written.  All the `-include' and `-imacros' options are processed
  414.      in the order in which they are written.
  415. `-imacros FILE'
  416.      Process FILE as input, discarding the resulting output, before
  417.      processing the regular input file.  Because the output generated
  418.      from FILE is discarded, the only effect of `-imacros FILE' is to
  419.      make the macros defined in FILE available for use in the main
  420.      input.
  421.      Any `-D' and `-U' options on the command line are always processed
  422.      before `-imacros FILE', regardless of the order in which they are
  423.      written.  All the `-include' and `-imacros' options are processed
  424.      in the order in which they are written.
  425. `-idirafter DIR'
  426.      Add the directory DIR to the second include path.  The directories
  427.      on the second include path are searched when a header file is not
  428.      found in any of the directories in the main include path (the one
  429.      that `-I' adds to).
  430. `-iprefix PREFIX'
  431.      Specify PREFIX as the prefix for subsequent `-iwithprefix' options.
  432. `-iwithprefix DIR'
  433.      Add a directory to the second include path.  The directory's name
  434.      is made by concatenating PREFIX and DIR, where PREFIX was
  435.      specified previously with `-iprefix'.  If you have not specified a
  436.      prefix yet, the directory containing the installed passes of the
  437.      compiler is used as the default.
  438. `-iwithprefixbefore DIR'
  439.      Add a directory to the main include path.  The directory's name is
  440.      made by concatenating PREFIX and DIR, as in the case of
  441.      `-iwithprefix'.
  442. `-isystem DIR'
  443.      Add a directory to the beginning of the second include path,
  444.      marking it as a system directory, so that it gets the same special
  445.      treatment as is applied to the standard system directories.
  446. `-nostdinc'
  447.      Do not search the standard system directories for header files.
  448.      Only the directories you have specified with `-I' options (and the
  449.      current directory, if appropriate) are searched.  *Note Directory
  450.      Options::, for information on `-I'.
  451.      By using both `-nostdinc' and `-I-', you can limit the include-file
  452.      search path to only those directories you specify explicitly.
  453. `-undef'
  454.      Do not predefine any nonstandard macros.  (Including architecture
  455.      flags).
  456.      Run only the C preprocessor.  Preprocess all the C source files
  457.      specified and output the results to standard output or to the
  458.      specified output file.
  459.      Tell the preprocessor not to discard comments.  Used with the `-E'
  460.      option.
  461.      Tell the preprocessor not to generate `#line' commands.  Used with
  462.      the `-E' option.
  463.      Tell the preprocessor to output a rule suitable for `make'
  464.      describing the dependencies of each object file.  For each source
  465.      file, the preprocessor outputs one `make'-rule whose target is the
  466.      object file name for that source file and whose dependencies are
  467.      all the `#include' header files it uses.  This rule may be a
  468.      single line or may be continued with `\'-newline if it is long.
  469.      The list of rules is printed on standard output instead of the
  470.      preprocessed C program.
  471.      `-M' implies `-E'.
  472.      Another way to specify output of a `make' rule is by setting the
  473.      environment variable `DEPENDENCIES_OUTPUT' (*note Environment
  474.      Variables::.).
  475. `-MM'
  476.      Like `-M' but the output mentions only the user header files
  477.      included with `#include "FILE"'.  System header files included
  478.      with `#include <FILE>' are omitted.
  479. `-MD'
  480.      Like `-M' but the dependency information is written to a file made
  481.      by replacing ".c" with ".d" at the end of the input file names.
  482.      This is in addition to compiling the file as specified--`-MD' does
  483.      not inhibit ordinary compilation the way `-M' does.
  484.      In Mach, you can use the utility `md' to merge multiple dependency
  485.      files into a single dependency file suitable for using with the
  486.      `make' command.
  487. `-MMD'
  488.      Like `-MD' except mention only user header files, not system
  489.      header files.
  490. `-MG'
  491.      Treat missing header files as generated files and assume they live
  492.      in the same directory as the source file.  If you specify `-MG',
  493.      you must also specify either `-M' or `-MM'.  `-MG' is not
  494.      supported with `-MD' or `-MMD'.
  495.      Print the name of each header file used, in addition to other
  496.      normal activities.
  497. `-AQUESTION(ANSWER)'
  498.      Assert the answer ANSWER for QUESTION, in case it is tested with a
  499.      preprocessor conditional such as `#if #QUESTION(ANSWER)'.  `-A-'
  500.      disables the standard assertions that normally describe the target
  501.      machine.
  502. `-DMACRO'
  503.      Define macro MACRO with the string `1' as its definition.
  504. `-DMACRO=DEFN'
  505.      Define macro MACRO as DEFN.  All instances of `-D' on the command
  506.      line are processed before any `-U' options.
  507. `-UMACRO'
  508.      Undefine macro MACRO.  `-U' options are evaluated after all `-D'
  509.      options, but before any `-include' and `-imacros' options.
  510. `-dM'
  511.      Tell the preprocessor to output only a list of the macro
  512.      definitions that are in effect at the end of preprocessing.  Used
  513.      with the `-E' option.
  514. `-dD'
  515.      Tell the preprocessing to pass all macro definitions into the
  516.      output, in their proper sequence in the rest of the output.
  517. `-dN'
  518.      Like `-dD' except that the macro arguments and contents are
  519.      omitted.  Only `#define NAME' is included in the output.
  520. `-trigraphs'
  521.      Support ANSI C trigraphs.  The `-ansi' option also has this effect.
  522. `-Wp,OPTION'
  523.      Pass OPTION as an option to the preprocessor.  If OPTION contains
  524.      commas, it is split into multiple options at the commas.
  525. File: gcc.info,  Node: Assembler Options,  Next: Link Options,  Prev: Preprocessor Options,  Up: Invoking GCC
  526. Passing Options to the Assembler
  527. ================================
  528.    You can pass options to the assembler.
  529. `-Wa,OPTION'
  530.      Pass OPTION as an option to the assembler.  If OPTION contains
  531.      commas, it is split into multiple options at the commas.
  532. File: gcc.info,  Node: Link Options,  Next: Directory Options,  Prev: Assembler Options,  Up: Invoking GCC
  533. Options for Linking
  534. ===================
  535.    These options come into play when the compiler links object files
  536. into an executable output file.  They are meaningless if the compiler is
  537. not doing a link step.
  538. `OBJECT-FILE-NAME'
  539.      A file name that does not end in a special recognized suffix is
  540.      considered to name an object file or library.  (Object files are
  541.      distinguished from libraries by the linker according to the file
  542.      contents.)  If linking is done, these object files are used as
  543.      input to the linker.
  544.      If any of these options is used, then the linker is not run, and
  545.      object file names should not be used as arguments.  *Note Overall
  546.      Options::.
  547. `-lLIBRARY'
  548.      Search the library named LIBRARY when linking.
  549.      It makes a difference where in the command you write this option;
  550.      the linker searches processes libraries and object files in the
  551.      order they are specified.  Thus, `foo.o -lz bar.o' searches
  552.      library `z' after file `foo.o' but before `bar.o'.  If `bar.o'
  553.      refers to functions in `z', those functions may not be loaded.
  554.      The linker searches a standard list of directories for the library,
  555.      which is actually a file named `libLIBRARY.a'.  The linker then
  556.      uses this file as if it had been specified precisely by name.
  557.      The directories searched include several standard system
  558.      directories plus any that you specify with `-L'.
  559.      Normally the files found this way are library files--archive files
  560.      whose members are object files.  The linker handles an archive
  561.      file by scanning through it for members which define symbols that
  562.      have so far been referenced but not defined.  But if the file that
  563.      is found is an ordinary object file, it is linked in the usual
  564.      fashion.  The only difference between using an `-l' option and
  565.      specifying a file name is that `-l' surrounds LIBRARY with `lib'
  566.      and `.a' and searches several directories.
  567. `-lobjc'
  568.      You need this special case of the `-l' option in order to link an
  569.      Objective C program.
  570. `-nostartfiles'
  571.      Do not use the standard system startup files when linking.  The
  572.      standard libraries are used normally.
  573. `-nostdlib'
  574.      Do not use the standard system libraries and startup files when
  575.      linking.  Only the files you specify will be passed to the linker.
  576.      One of the standard libraries bypassed by `-nostdlib' is
  577.      `libgcc.a', a library of internal subroutines that GNU CC uses to
  578.      overcome shortcomings of particular machines, or special needs for
  579.      some languages.  (*Note Interfacing to GNU CC Output: Interface,
  580.      for more discussion of `libgcc.a'.) In most cases, you need
  581.      `libgcc.a' even when you want to avoid other standard libraries.
  582.      In other words, when you specify `-nostdlib' you should usually
  583.      specify `-lgcc' as well.  This ensures that you have no unresolved
  584.      references to internal GNU CC library subroutines.  (For example,
  585.      `__main', used to ensure C++ constructors will be called; *note
  586.      `collect2': Collect2..)
  587.      Remove all symbol table and relocation information from the
  588.      executable.
  589. `-static'
  590.      On systems that support dynamic linking, this prevents linking
  591.      with the shared libraries.  On other systems, this option has no
  592.      effect.
  593. `-shared'
  594.      Produce a shared object which can then be linked with other
  595.      objects to form an executable.  Only a few systems support this
  596.      option.
  597. `-symbolic'
  598.      Bind references to global symbols when building a shared object.
  599.      Warn about any unresolved references (unless overridden by the
  600.      link editor option `-Xlinker -z -Xlinker defs').  Only a few
  601.      systems support this option.
  602. `-Xlinker OPTION'
  603.      Pass OPTION as an option to the linker.  You can use this to
  604.      supply system-specific linker options which GNU CC does not know
  605.      how to recognize.
  606.      If you want to pass an option that takes an argument, you must use
  607.      `-Xlinker' twice, once for the option and once for the argument.
  608.      For example, to pass `-assert definitions', you must write
  609.      `-Xlinker -assert -Xlinker definitions'.  It does not work to write
  610.      `-Xlinker "-assert definitions"', because this passes the entire
  611.      string as a single argument, which is not what the linker expects.
  612. `-Wl,OPTION'
  613.      Pass OPTION as an option to the linker.  If OPTION contains
  614.      commas, it is split into multiple options at the commas.
  615. `-u SYMBOL'
  616.      Pretend the symbol SYMBOL is undefined, to force linking of
  617.      library modules to define it.  You can use `-u' multiple times with
  618.      different symbols to force loading of additional library modules.
  619. File: gcc.info,  Node: Directory Options,  Next: Target Options,  Prev: Link Options,  Up: Invoking GCC
  620. Options for Directory Search
  621. ============================
  622.    These options specify directories to search for header files, for
  623. libraries and for parts of the compiler:
  624. `-IDIR'
  625.      Append directory DIR to the list of directories searched for
  626.      include files.
  627. `-I-'
  628.      Any directories you specify with `-I' options before the `-I-'
  629.      option are searched only for the case of `#include "FILE"'; they
  630.      are not searched for `#include <FILE>'.
  631.      If additional directories are specified with `-I' options after
  632.      the `-I-', these directories are searched for all `#include'
  633.      directives.  (Ordinarily *all* `-I' directories are used this way.)
  634.      In addition, the `-I-' option inhibits the use of the current
  635.      directory (where the current input file came from) as the first
  636.      search directory for `#include "FILE"'.  There is no way to
  637.      override this effect of `-I-'.  With `-I.' you can specify
  638.      searching the directory which was current when the compiler was
  639.      invoked.  That is not exactly the same as what the preprocessor
  640.      does by default, but it is often satisfactory.
  641.      `-I-' does not inhibit the use of the standard system directories
  642.      for header files.  Thus, `-I-' and `-nostdinc' are independent.
  643. `-LDIR'
  644.      Add directory DIR to the list of directories to be searched for
  645.      `-l'.
  646. `-BPREFIX'
  647.      This option specifies where to find the executables, libraries,
  648.      include files, and data files of the compiler itself.
  649.      The compiler driver program runs one or more of the subprograms
  650.      `cpp', `cc1', `as' and `ld'.  It tries PREFIX as a prefix for each
  651.      program it tries to run, both with and without `MACHINE/VERSION/'
  652.      (*note Target Options::.).
  653.      For each subprogram to be run, the compiler driver first tries the
  654.      `-B' prefix, if any.  If that name is not found, or if `-B' was
  655.      not specified, the driver tries two standard prefixes, which are
  656.      `/usr/lib/gcc/' and `/usr/local/lib/gcc-lib/'.  If neither of
  657.      those results in a file name that is found, the unmodified program
  658.      name is searched for using the directories specified in your
  659.      `PATH' environment variable.
  660.      `-B' prefixes that effectively specify directory names also apply
  661.      to libraries in the linker, because the compiler translates these
  662.      options into `-L' options for the linker.  They also apply to
  663.      includes files in the preprocessor, because the compiler
  664.      translates these options into `-isystem' options for the
  665.      preprocessor.  In this case, the compiler appends `include' to the
  666.      prefix.
  667.      The run-time support file `libgcc.a' can also be searched for using
  668.      the `-B' prefix, if needed.  If it is not found there, the two
  669.      standard prefixes above are tried, and that is all.  The file is
  670.      left out of the link if it is not found by those means.
  671.      Another way to specify a prefix much like the `-B' prefix is to use
  672.      the environment variable `GCC_EXEC_PREFIX'.  *Note Environment
  673.      Variables::.
  674. File: gcc.info,  Node: Target Options,  Next: Submodel Options,  Prev: Directory Options,  Up: Invoking GCC
  675. Specifying Target Machine and Compiler Version
  676. ==============================================
  677.    By default, GNU CC compiles code for the same type of machine that
  678. you are using.  However, it can also be installed as a cross-compiler,
  679. to compile for some other type of machine.  In fact, several different
  680. configurations of GNU CC, for different target machines, can be
  681. installed side by side.  Then you specify which one to use with the
  682. `-b' option.
  683.    In addition, older and newer versions of GNU CC can be installed side
  684. by side.  One of them (probably the newest) will be the default, but
  685. you may sometimes wish to use another.
  686. `-b MACHINE'
  687.      The argument MACHINE specifies the target machine for compilation.
  688.      This is useful when you have installed GNU CC as a cross-compiler.
  689.      The value to use for MACHINE is the same as was specified as the
  690.      machine type when configuring GNU CC as a cross-compiler.  For
  691.      example, if a cross-compiler was configured with `configure
  692.      i386v', meaning to compile for an 80386 running System V, then you
  693.      would specify `-b i386v' to run that cross compiler.
  694.      When you do not specify `-b', it normally means to compile for the
  695.      same type of machine that you are using.
  696. `-V VERSION'
  697.      The argument VERSION specifies which version of GNU CC to run.
  698.      This is useful when multiple versions are installed.  For example,
  699.      VERSION might be `2.0', meaning to run GNU CC version 2.0.
  700.      The default version, when you do not specify `-V', is controlled
  701.      by the way GNU CC is installed.  Normally, it will be a version
  702.      that is recommended for general use.
  703.    The `-b' and `-V' options actually work by controlling part of the
  704. file name used for the executable files and libraries used for
  705. compilation.  A given version of GNU CC, for a given target machine, is
  706. normally kept in the directory `/usr/local/lib/gcc-lib/MACHINE/VERSION'.
  707.    Thus, sites can customize the effect of `-b' or `-V' either by
  708. changing the names of these directories or adding alternate names (or
  709. symbolic links).  If in directory `/usr/local/lib/gcc-lib/' the file
  710. `80386' is a link to the file `i386v', then `-b 80386' becomes an alias
  711. for `-b i386v'.
  712.    In one respect, the `-b' or `-V' do not completely change to a
  713. different compiler: the top-level driver program `gcc' that you
  714. originally invoked continues to run and invoke the other executables
  715. (preprocessor, compiler per se, assembler and linker) that do the real
  716. work.  However, since no real work is done in the driver program, it
  717. usually does not matter that the driver program in use is not the one
  718. for the specified target and version.
  719.    The only way that the driver program depends on the target machine is
  720. in the parsing and handling of special machine-specific options.
  721. However, this is controlled by a file which is found, along with the
  722. other executables, in the directory for the specified version and
  723. target machine.  As a result, a single installed driver program adapts
  724. to any specified target machine and compiler version.
  725.    The driver program executable does control one significant thing,
  726. however: the default version and target machine.  Therefore, you can
  727. install different instances of the driver program, compiled for
  728. different targets or versions, under different names.
  729.    For example, if the driver for version 2.0 is installed as `ogcc'
  730. and that for version 2.1 is installed as `gcc', then the command `gcc'
  731. will use version 2.1 by default, while `ogcc' will use 2.0 by default.
  732. However, you can choose either version with either command with the
  733. `-V' option.
  734. File: gcc.info,  Node: Submodel Options,  Next: Code Gen Options,  Prev: Target Options,  Up: Invoking GCC
  735. Hardware Models and Configurations
  736. ==================================
  737.    Earlier we discussed the standard option `-b' which chooses among
  738. different installed compilers for completely different target machines,
  739. such as Vax vs. 68000 vs. 80386.
  740.    In addition, each of these target machine types can have its own
  741. special options, starting with `-m', to choose among various hardware
  742. models or configurations--for example, 68010 vs 68020, floating
  743. coprocessor or none.  A single installed version of the compiler can
  744. compile for any model or configuration, according to the options
  745. specified.
  746.    Some configurations of the compiler also support additional special
  747. options, usually for compatibility with other compilers on the same
  748. platform.
  749.    These options are defined by the macro `TARGET_SWITCHES' in the
  750. machine description.  The default for the options is also defined by
  751. that macro, which enables you to change the defaults.
  752. * Menu:
  753. * M680x0 Options::
  754. * VAX Options::
  755. * SPARC Options::
  756. * Convex Options::
  757. * AMD29K Options::
  758. * ARM Options::
  759. * M88K Options::
  760. * RS/6000 and PowerPC Options::
  761. * RT Options::
  762. * MIPS Options::
  763. * i386 Options::
  764. * HPPA Options::
  765. * Intel 960 Options::
  766. * DEC Alpha Options::
  767. * Clipper Options::
  768. * H8/300 Options::
  769. * System V Options::
  770. File: gcc.info,  Node: M680x0 Options,  Next: VAX Options,  Up: Submodel Options
  771. M680x0 Options
  772. --------------
  773.    These are the `-m' options defined for the 68000 series.  The default
  774. values for these options depends on which style of 68000 was selected
  775. when the compiler was configured; the defaults for the most common
  776. choices are given below.
  777. `-m68000'
  778. `-mc68000'
  779.      Generate output for a 68000.  This is the default when the
  780.      compiler is configured for 68000-based systems.
  781. `-m68020'
  782. `-mc68020'
  783.      Generate output for a 68020.  This is the default when the
  784.      compiler is configured for 68020-based systems.
  785. `-m68881'
  786.      Generate output containing 68881 instructions for floating point.
  787.      This is the default for most 68020 systems unless `-nfp' was
  788.      specified when the compiler was configured.
  789. `-m68030'
  790.      Generate output for a 68030.  This is the default when the
  791.      compiler is configured for 68030-based systems.
  792. `-m68040'
  793.      Generate output for a 68040.  This is the default when the
  794.      compiler is configured for 68040-based systems.
  795.      This option inhibits the use of 68881/68882 instructions that have
  796.      to be emulated by software on the 68040.  If your 68040 does not
  797.      have code to emulate those instructions, use `-m68040'.
  798. `-m68020-40'
  799.      Generate output for a 68040, without using any of the new
  800.      instructions.  This results in code which can run relatively
  801.      efficiently on either a 68020/68881 or a 68030 or a 68040.  The
  802.      generated code does use the 68881 instructions that are emulated
  803.      on the 68040.
  804. `-mfpa'
  805.      Generate output containing Sun FPA instructions for floating point.
  806. `-msoft-float'
  807.      Generate output containing library calls for floating point.
  808.      *Warning:* the requisite libraries are not part of GNU CC.
  809.      Normally the facilities of the machine's usual C compiler are
  810.      used, but this can't be done directly in cross-compilation.  You
  811.      must make your own arrangements to provide suitable library
  812.      functions for cross-compilation.
  813. `-mshort'
  814.      Consider type `int' to be 16 bits wide, like `short int'.
  815. `-mnobitfield'
  816.      Do not use the bit-field instructions.  The `-m68000' option
  817.      implies `-mnobitfield'.
  818. `-mbitfield'
  819.      Do use the bit-field instructions.  The `-m68020' option implies
  820.      `-mbitfield'.  This is the default if you use a configuration
  821.      designed for a 68020.
  822. `-mrtd'
  823.      Use a different function-calling convention, in which functions
  824.      that take a fixed number of arguments return with the `rtd'
  825.      instruction, which pops their arguments while returning.  This
  826.      saves one instruction in the caller since there is no need to pop
  827.      the arguments there.
  828.      This calling convention is incompatible with the one normally used
  829.      on Unix, so you cannot use it if you need to call libraries
  830.      compiled with the Unix compiler.
  831.      Also, you must provide function prototypes for all functions that
  832.      take variable numbers of arguments (including `printf'); otherwise
  833.      incorrect code will be generated for calls to those functions.
  834.      In addition, seriously incorrect code will result if you call a
  835.      function with too many arguments.  (Normally, extra arguments are
  836.      harmlessly ignored.)
  837.      The `rtd' instruction is supported by the 68010 and 68020
  838.      processors, but not by the 68000.
  839. File: gcc.info,  Node: VAX Options,  Next: SPARC Options,  Prev: M680x0 Options,  Up: Submodel Options
  840. VAX Options
  841. -----------
  842.    These `-m' options are defined for the Vax:
  843. `-munix'
  844.      Do not output certain jump instructions (`aobleq' and so on) that
  845.      the Unix assembler for the Vax cannot handle across long ranges.
  846. `-mgnu'
  847.      Do output those jump instructions, on the assumption that you will
  848.      assemble with the GNU assembler.
  849. `-mg'
  850.      Output code for g-format floating point numbers instead of
  851.      d-format.
  852. File: gcc.info,  Node: SPARC Options,  Next: Convex Options,  Prev: VAX Options,  Up: Submodel Options
  853. SPARC Options
  854. -------------
  855.    These `-m' switches are supported on the SPARC:
  856. `-mno-app-regs'
  857. `-mapp-regs'
  858.      Specify `-mapp-regs' to generate output using the global registers
  859.      2 through 4, which the SPARC SVR4 ABI reserves for applications.
  860.      This is the default.
  861.      To be fully SVR4 ABI compliant at the cost of some performance
  862.      loss, specify `-mno-app-regs'.  You should compile libraries and
  863.      system software with this option.
  864. `-mfpu'
  865. `-mhard-float'
  866.      Generate output containing floating point instructions.  This is
  867.      the default.
  868. `-mno-fpu'
  869. `-msoft-float'
  870.      Generate output containing library calls for floating point.
  871.      *Warning:* there is no GNU floating-point library for SPARC.
  872.      Normally the facilities of the machine's usual C compiler are
  873.      used, but this cannot be done directly in cross-compilation.  You
  874.      must make your own arrangements to provide suitable library
  875.      functions for cross-compilation.
  876.      `-msoft-float' changes the calling convention in the output file;
  877.      therefore, it is only useful if you compile *all* of a program with
  878.      this option.  In particular, you need to compile `libgcc.a', the
  879.      library that comes with GNU CC, with `-msoft-float' in order for
  880.      this to work.
  881. `-mhard-quad-float'
  882.      Generate output containing quad-word (long double) floating point
  883.      instructions.
  884. `-msoft-quad-float'
  885.      Generate output containing library calls for quad-word (long
  886.      double) floating point instructions.  The functions called are
  887.      those specified in the SPARC ABI.  This is the default.
  888.      As of this writing, there are no sparc implementations that have
  889.      hardware support for the quad-word floating point instructions.
  890.      They all invoke a trap handler for one of these instructions, and
  891.      then the trap handler emulates the effect of the instruction.
  892.      Because of the trap handler overhead, this is much slower than
  893.      calling the ABI library routines.  Thus the `-msoft-quad-float'
  894.      option is the default.
  895. `-mno-epilogue'
  896. `-mepilogue'
  897.      With `-mepilogue' (the default), the compiler always emits code for
  898.      function exit at the end of each function.  Any function exit in
  899.      the middle of the function (such as a return statement in C) will
  900.      generate a jump to the exit code at the end of the function.
  901.      With `-mno-epilogue', the compiler tries to emit exit code inline
  902.      at every function exit.
  903. `-mno-flat'
  904. `-mflat'
  905.      With `-mflat', the compiler does not generate save/restore
  906.      instructions and will use a "flat" or single register window
  907.      calling convention.  This model uses %i7 as the frame pointer and
  908.      is compatible with the normal register window model.  Code from
  909.      either may be intermixed although debugger support is still
  910.      incomplete.  The local registers and the input registers (0-5) are
  911.      still treated as "call saved" registers and will be saved on the
  912.      stack as necessary.
  913.      With `-mno-flat' (the default), the compiler emits save/restore
  914.      instructions (except for leaf functions) and is the normal mode of
  915.      operation.
  916. `-mno-unaligned-doubles'
  917. `-munaligned-doubles'
  918.      Assume that doubles have 8 byte alignment.  This is the default.
  919.      With `-munaligned-doubles', GNU CC assumes that doubles have 8 byte
  920.      alignment only if they are contained in another type, or if they
  921.      have an absolute address.  Otherwise, it assumes they have 4 byte
  922.      alignment.  Specifying this option avoids some rare compatibility
  923.      problems with code generated by other compilers.  It is not the
  924.      default because it results in a performance loss, especially for
  925.      floating point code.
  926. `-mv8'
  927. `-msparclite'
  928.      These two options select variations on the SPARC architecture.
  929.      By default (unless specifically configured for the Fujitsu
  930.      SPARClite), GCC generates code for the v7 variant of the SPARC
  931.      architecture.
  932.      `-mv8' will give you SPARC v8 code.  The only difference from v7
  933.      code is that the compiler emits the integer multiply and integer
  934.      divide instructions which exist in SPARC v8 but not in SPARC v7.
  935.      `-msparclite' will give you SPARClite code.  This adds the integer
  936.      multiply, integer divide step and scan (`ffs') instructions which
  937.      exist in SPARClite but not in SPARC v7.
  938. `-mcypress'
  939. `-msupersparc'
  940.      These two options select the processor for which the code is
  941.      optimised.
  942.      With `-mcypress' (the default), the compiler optimizes code for the
  943.      Cypress CY7C602 chip, as used in the SparcStation/SparcServer 3xx
  944.      series.  This is also apropriate for the older SparcStation 1, 2,
  945.      IPX etc.
  946.      With `-msupersparc' the compiler optimizes code for the SuperSparc
  947.      cpu, as used in the SparcStation 10, 1000 and 2000 series. This
  948.      flag also enables use of the full SPARC v8 instruction set.
  949.    In a future version of GCC, these options will very likely be
  950. renamed to `-mcpu=cypress' and `-mcpu=supersparc'.
  951.    These `-m' switches are supported in addition to the above on SPARC
  952. V9 processors:
  953. `-mmedlow'
  954.      Generate code for the Medium/Low code model: assume a 32 bit
  955.      address space.  Programs are statically linked, PIC is not
  956.      supported.  Pointers are still 64 bits.
  957.      It is very likely that a future version of GCC will rename this
  958.      option.
  959. `-mmedany'
  960.      Generate code for the Medium/Anywhere code model: assume a 32 bit
  961.      text segment starting at offset 0, and a 32 bit data segment
  962.      starting anywhere (determined at link time).  Programs are
  963.      statically linked, PIC is not supported.  Pointers are still 64
  964.      bits.
  965.      It is very likely that a future version of GCC will rename this
  966.      option.
  967. `-mint64'
  968.      Types long and int are 64 bits.
  969. `-mlong32'
  970.      Types long and int are 32 bits.
  971. `-mlong64'
  972. `-mint32'
  973.      Type long is 64 bits, and type int is 32 bits.
  974. `-mstack-bias'
  975. `-mno-stack-bias'
  976.      With `-mstack-bias', GNU CC assumes that the stack pointer, and
  977.      frame pointer if present, are offset by -2047 which must be added
  978.      back when making stack frame references.  Otherwise, assume no
  979.      such offset is present.
  980.